package com.th.therp.pojo.dto;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UpdateUserDto {
    private Integer id;

    @NotNull(message = "用户名称不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{2,20}$", message = "用户名必须是4-20位字母、数字或下划线")
    private String username;

    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d!@#$%^&*]{8,20}$", message = "密码格式不正确，必须是8-20位，含字母和数字")
    private String Password;

}
